<?php
	$active = isset($active) ? $active : NULL;
?>

<div data-role="navbar">
	<ul>
		<li><a class="<?=$active == 'list' ? 'ui-btn-active':''?> ui-state-persist" data-icon="grid" href="<?=site_url('')?>" data-transition="none">목록</a></li>
		<li><a class="<?=$active == 'search' ? 'ui-btn-active':''?> ui-state-persist" data-icon="search" href="<?=site_url('poll/search')?>" data-transition="none">검색</a></li>
	<?php if($this->user_lib->is_logged_in()): ?>
			<li><a class="<?=$active == 'create_poll'?'ui-btn-active':''?> ui-state-persist" data-icon="plus" href="<?=site_url('poll/create')?>" data-ajax="false" data-transition="none">설문작성</a></li>
		<?php if($this->user_lib->is_admin()):?>
			<li><a class="<?=$active == 'admin' ? 'ui-btn-active':''?> ui-state-persist" data-icon="gear" href="<?=site_url('admin')?>" data-transition="none">관리자 메뉴</a></li>
		<?php else: ?>
			<li><a data-icon="delete" href="<?=site_url('user/logout')?>" data-transition="none">로그아웃</a></li>
		<?php endif; ?>
	<?php else: ?>
			<li><a class="<?=$active == 'login' ? 'ui-btn-active' : ''?> ui-state-persist" data-icon="check" href="<?=site_url('user/login')?>" data-transition="none">로그인</a></li>
			<li><a class="<?=$active == 'register' ? 'ui-btn-active' : ''?> ui-state-persist" data-icon="forward" href="<?=site_url('user/register')?>" data-transition="none">회원가입</a></li>
		<?php endif; ?>
	</ul>
</div><!-- /navbar -->